package cn.iocoder.yudao.module.resource.dal.mysql.story;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.resource.dal.dataobject.story.StoryDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.resource.controller.admin.story.vo.*;

/**
 * 场景 Mapper
 *
 * @author lizhongwen
 */
@Mapper
public interface StoryMapper extends BaseMapperX<StoryDO> {

    default PageResult<StoryDO> selectPage(StoryPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<StoryDO>()
                .eqIfPresent(StoryDO::getRoleId, reqVO.getRoleId())
                .likeIfPresent(StoryDO::getName, reqVO.getName())
                .likeIfPresent(StoryDO::getRpg, reqVO.getRpg())
                .eqIfPresent(StoryDO::getHeartbeatLevel, reqVO.getHeartbeatLevel())
                .orderByDesc(StoryDO::getId));
    }

}